import com.gmongo.GMongo

includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsBootstrap")

target(main: "Cleans up all data in the database") {
    depends bootstrap
    
    def db = new GMongo().getDB(grailsApp.config.grails.mongo.databaseName)
    db.getCollectionNames().each {
        if ( !(it =~ /system\./) ) {
            db.getCollection(it).drop()
        }
    }
}

setDefaultTarget(main)
